package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.FieldMeta;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 机架 实体
 * </p>
 *
 * @author ping
 * @since 2020-06-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
// "DeviceFrame对象", description = "机架")
public class DeviceFrame extends Model<DeviceFrame> {

    private static final long serialVersionUID = 1L;

    // "自增id")
    @TableId(value = "frame_id", type = IdType.AUTO)
    private Integer frameId;

    // "机架名称")
    @FieldMeta(name = "机架名称", description = "机架名称")
    private String frameName;

    // "机架描述")
    @FieldMeta(name = "机架描述", description = "机架描述")
    private String detail;

    // "机房Id")
    @FieldMeta(name = "机房Id", description = "机房Id")
    private Long equipmentroomId;

    // "部门id")
    private Long deptId;

    // "机架层数(8-20)")
    @FieldMeta(name = "机架层数", description = "机架层数")
    private Integer layer;

    // "机架高度(m)")
    @FieldMeta(name = "机架高度", description = "机架高度")
    private BigDecimal height;

    // "行号")
    @FieldMeta(name = "行号", description = "行号")
    private Integer row;

    // "列号")
    @FieldMeta(name = "列号", description = "列号")
    private Integer col;

    // "供应商")
    @FieldMeta(name = "供应商", description = "供应商")
    private String supplier;

    // "备注")
    @FieldMeta(name = "备注", description = "备注")
    private String remark;

    // "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    // "创建人")
    private String createBy;

    @TableField(exist = false)
    private List<DeviceDevice> children;

    @Override
    public Serializable pkVal() {
        return this.frameId;
    }

}
